.class Lcom/melesta/payment/inapp3/InAppSystem$2;
.super Ljava/lang/Object;
.source "InAppSystem.java"

# interfaces
.implements Lcom/melesta/payment/inapp3/IabHelper$OnIabSetupFinishedListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/melesta/payment/inapp3/InAppSystem;->onCreate(Landroid/content/Context;Landroid/os/Handler;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/melesta/payment/inapp3/InAppSystem;


# direct methods
.method constructor <init>(Lcom/melesta/payment/inapp3/InAppSystem;)V
    .locals 0
    .parameter

    .prologue
    .line 178
    iput-object p1, p0, Lcom/melesta/payment/inapp3/InAppSystem$2;->this$0:Lcom/melesta/payment/inapp3/InAppSystem;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onIabSetupFinished(Lcom/melesta/payment/inapp3/IabResult;)V
    .locals 8
    .parameter "result"

    .prologue
    .line 181
    const-string v5, "payment-inapp"

    const-string v6, "Setup finished."

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 183
    invoke-virtual {p1}, Lcom/melesta/payment/inapp3/IabResult;->isFailure()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 185
    const-string v5, "payment-inapp"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Problem setting up in-app billing: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 203
    :goto_0
    return-void

    .line 191
    :cond_0
    const-string v5, "payment-inapp"

    const-string v6, "Setup successful. Querying inventory."

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 193
    invoke-static {}, Lcom/melesta/payment/PaymentManager;->getInstance()Lcom/melesta/payment/PaymentManager;

    move-result-object v1

    .line 194
    .local v1, pm:Lcom/melesta/payment/PaymentManager;
    iget-object v5, p0, Lcom/melesta/payment/inapp3/InAppSystem$2;->this$0:Lcom/melesta/payment/inapp3/InAppSystem;

    invoke-virtual {v5}, Lcom/melesta/payment/inapp3/InAppSystem;->getName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v1, v5}, Lcom/melesta/payment/PaymentManager;->getAllRequests(Ljava/lang/String;)Ljava/util/List;

    move-result-object v3

    .line 196
    .local v3, requests:Ljava/util/List;,"Ljava/util/List<Lcom/melesta/payment/interfaces/IRequest;>;"
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    .line 198
    .local v4, skus:Ljava/util/List;,"Ljava/util/List<Ljava/lang/String;>;"
    invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_1
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/melesta/payment/interfaces/IRequest;

    .line 199
    .local v2, r:Lcom/melesta/payment/interfaces/IRequest;
    invoke-interface {v2}, Lcom/melesta/payment/interfaces/IRequest;->getSku()Ljava/lang/String;

    move-result-object v5

    invoke-interface {v4, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_1

    .line 202
    .end local v2           #r:Lcom/melesta/payment/interfaces/IRequest;
    :cond_1
    iget-object v5, p0, Lcom/melesta/payment/inapp3/InAppSystem$2;->this$0:Lcom/melesta/payment/inapp3/InAppSystem;

    iget-object v5, v5, Lcom/melesta/payment/inapp3/InAppSystem;->mHelper:Lcom/melesta/payment/inapp3/IabHelper;

    const/4 v6, 0x1

    iget-object v7, p0, Lcom/melesta/payment/inapp3/InAppSystem$2;->this$0:Lcom/melesta/payment/inapp3/InAppSystem;

    iget-object v7, v7, Lcom/melesta/payment/inapp3/InAppSystem;->mGotInventoryListener:Lcom/melesta/payment/inapp3/IabHelper$QueryInventoryFinishedListener;

    invoke-virtual {v5, v6, v4, v7}, Lcom/melesta/payment/inapp3/IabHelper;->queryInventoryAsync(ZLjava/util/List;Lcom/melesta/payment/inapp3/IabHelper$QueryInventoryFinishedListener;)V

    goto :goto_0
.end method
